]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
style: Be consistent with Adwaita flat elements in High Contrast
authorSam Hewitt <snwh@gnome.org>
Thu, 25 Jan 2024 15:41:26 +0000 (12:11 -0330)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 25 Jan 2024 16:46:41 +0000 (16:46 +0000)
- update drawing mixin for buttons to override HC inset in flat style
- drop outlines for app icons in dash

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3143>

data/theme/gnome-shell-sass/_drawing.scss
data/theme/gnome-shell-sass/widgets/_dash.scss

index 07020ee71177917ce23327517c41d01402c56590..60fd49ab6a0bf6d99ab80b4c8c1affa7e3bc287e 100644 (file)
 //
 
 // Draw the inset for High Contrast elements
-@mixin draw_hc_inset($width: 1px, $fc: $hc_inset_color, $border: false) {
-  box-shadow: inset 0 0 0 $width $fc;
+@mixin draw_hc_inset($width: 1px, $ic: $hc_inset_color, $border: false, $no_inset: false) {
+  //
+  // $width     width of the inset, in pixels
+  // $ic        color of the inset
+  //
+  // $border    if true, use a border instead of a box-shadow to draw inset
+  // $no_inset  if true, override the mixin to not draw an iset
+  //
+
+  box-shadow: inset 0 0 0 $width $ic;
+
+  // draw inset as border
   @if $border {
-    border: $width solid $fc;
+    border: $width solid $ic;
     box-shadow: none;
   }
+
+  // don't draw an inset at all
+  @if $no_inset {
+    box-shadow: none;
+    border: none;
+  }
 }
 
 // Draw the focus ring
     }
 
     @if $style == 'default' {
-      @include draw_hc_inset($width:0px);
+      @include draw_hc_inset($no_inset: true);
     }
   }
 
   @if $type == 'normal' {
     color: $tc;
     background-color: $button_bg_color;
+
+    // no inset in High Contrast when the style is flat
+    @if $style == 'flat' and $contrast == 'high' {
+      @include draw_hc_inset($no_inset: true);
+    }
   }
 
   // hover button
 
     // no outline in High Contrast for insensitive buttons
     @if $contrast == 'high' {
-      @include draw_hc_inset($fc:transparent);
+      @include draw_hc_inset($no_inset: true);
     }
   }
 
     &:insensitive { @include button(insensitive, $tc:$fg, $c:$bg, $style: flat, $always_dark: $system);}
   }
 
-  @if $contrast == 'high' {
-    @include draw_hc_inset();
-  }
 
   &:highlighted {
     // brighter background color than other states
index 84c07672f68d8be4289293620376a49ba5b8a4e6..db378ca1e4306fddb7964cdcae9388faebcfae7a 100644 (file)
@@ -58,10 +58,6 @@ $dash_spacing: $base_margin * 0.5;
       .overview-icon {
         @extend %tile;
         @include button(normal, $tc:$fg, $c:$bg, $style: flat, $always_dark: true);
-
-        @if $contrast == 'high' {
-          @include draw_hc_inset();
-        }
       }
 
       &:focus .overview-icon { @include button(focus, $tc:$fg, $c:$bg, $style: flat, $always_dark: true);}